package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.AuthDto;
import com.heima.model.wemedia.pojos.WmUser;
import com.heima.wemedia.service.WmUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/v1/auth")
public class WmUserController {

    @Resource
    private WmUserService wmUserService;

    @PostMapping("/list")
    public ResponseResult<List<WmUser>> list(@RequestBody AuthDto authDto){
        return wmUserService.myList(authDto);
    }

    @PostMapping("/authFail")
    public ResponseResult<String> authFail (@RequestBody AuthDto authDto){
        return wmUserService.authFail(authDto);
    }

    @PostMapping("/authPass")
    public ResponseResult<String> authPass (@RequestBody AuthDto authDto){
        return wmUserService.authPass(authDto);
    }
}
